package com.wyx.system.common;


import lombok.Data;

/**
 * 暂定折磨多
 */
@Data
public class ResultResponse {
    private String code;
    private String msg;
    private Object data;

    public ResultResponse(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResultResponse(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static ResultResponse  sucess(){
        return  new ResultResponse(ResponseEnum.OK.getCode(),ResponseEnum.OK.getMsg());
    };

    public static ResultResponse  sucess(Object data){
        return  new ResultResponse(ResponseEnum.OK.getCode(),ResponseEnum.OK.getMsg(),data);
    };

    public static ResultResponse  error(){
        return  new ResultResponse(ResponseEnum.ERROR.getCode(),ResponseEnum.ERROR.getMsg());
    };

    public static ResultResponse  error(Object data){
        return  new ResultResponse(ResponseEnum.ERROR.getCode(),ResponseEnum.ERROR.getMsg(),data);
    };

}
